#ifndef HANDLETASK_H_
#define HANDLETASK_H_

#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <signal.h>
#include <sys/stat.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <stdlib.h>
#include "Task.h"
#include "util/fileUtil.h"
#include "../vIRm/sharedMemory/sharedMemory.h"


/**
 * Redirect the string to the named fifo
 */
void redirectStdoutToMkfifo(void);

/**
 * Initialisize the task handler, load work methode, map shared memory and signals set 
 */
void initTaskHandler(void* handle, char* mem_file);

/**
 * Listen to the task incoming in the pipe 
 */
void listenTasks(void);

/**
 *	Manage and execute the tasks 
 *  -> work task
 *  -> waifor task
 *  -> waitall task
 *  -> free task
 */
void handleTask(Task* t);

#endif /*HANDLETASK_H_*/
